'use strict'

const Controller = require('egg').Controller

class lfynewsmess extends Controller {
  async index() {
    const data = await this.ctx.service.lfynewsmess.findAll(this.ctx)
    this.ctx.body = data
  }
  async create() {
    const ctx = this.ctx
    const params = ctx.request.body
    const data = await ctx.service.lfynewsmess.create(params)
    ctx.body = data
  }
  async destroy() {
    const ctx = this.ctx
    const lfynewsmessId = ctx.params.id
    const del = await ctx.service.lfynewsmess.delete(lfynewsmessId)
    ctx.body = del
  }
  async update() {
    const ctx = this.ctx
    const lfynewsmessId = ctx.params.id
    const params = ctx.request.body
    const change = await ctx.service.lfynewsmess.update(lfynewsmessId, params)
    ctx.body = change
  }
  async show() {
    const ctx = this.ctx
    const id = ctx.params.id
    const lfynewsmess = await this.ctx.service.lfynewsmess.find(id)
    ctx.body = lfynewsmess
  }
  async index0() {
    const ctx = this.ctx
    const pass = ctx.params.age
    console.log(pass)
    const data = await this.ctx.service.lfynewsmess.findAll0(pass)
    this.ctx.body = data
  }
}
module.exports = lfynewsmess
